package com.jinpeng.hr.service.impl;

import com.jinpeng.common.annotation.TargetDataSource;
import com.jinpeng.hr.dao.DemoDao;
import com.jinpeng.hr.domain.DemoDO;
import com.jinpeng.hr.service.DemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DemoServiceImpl implements DemoService {
    //("demoService")
    @Autowired
    private DemoDao demoDao;


    @TargetDataSource(value = "secondaryDataSource")

    //动态切换数据源
    @Override
    public List<DemoDO> queryAll() {
        return demoDao.queryAll();
    }


}
